package com.gtw.modules.api.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.gtw.modules.api.service.TbActivityServices;
import com.gtw.modules.dao.TbActivityDao;
import com.gtw.modules.entity.TbActivity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("tbactivityservice")
public class TbActivityServicesImpl implements TbActivityServices {

    @Autowired
    private TbActivityDao tbActivityDao;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tbActivityDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TbActivity record) {
        return tbActivityDao.insert(record);
    }

    @Override
    public int insertSelective(TbActivity record) {
        return tbActivityDao.insertSelective(record);
    }

    @Override
    public TbActivity selectByPrimaryKey(Integer id) {
        return tbActivityDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TbActivity record) {
        return tbActivityDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(TbActivity record) {
        return tbActivityDao.updateByPrimaryKeyWithBLOBs(record);
    }

    @Override
    public int updateByPrimaryKey(TbActivity record) {
        return tbActivityDao.updateByPrimaryKey(record);
    }

    @Override
    public Page<TbActivity> queryPageList(Page<TbActivity> pageUtil, Map<String, Object> map) {
        pageUtil.setRecords(tbActivityDao.queryPageList(pageUtil, map));
        return pageUtil;
    }

    @Override
    public List<TbActivity> foundAll() {
        return tbActivityDao.foundAll();
    }

    @Override
    public List<TbActivity> foundBySpike() {
        return tbActivityDao.foundBySpike();
    }

    /**
     * 查询未结束的活动
     *
     * @return
     */
    @Override
    public List<TbActivity> findNoClosed() {
        return tbActivityDao.findNoClosed();
    }
}
